﻿using System;
using System.Collections.Specialized;
using System.IO;

using WebDavProcessor.Interfaces;

namespace WebDavProcessor.Methods
{
    public class WebDavSimpleRequest : IWebDavRequest
    {
        private string requestMethod;
        private Uri requestUri;
        private NameValueCollection requestHeaders;
        private Stream requestStream;

        string IWebDavRequest.Method { get { return requestMethod; } set { requestMethod = value; } }
        Uri IWebDavRequest.RequestUri { get { return requestUri; } set { requestUri = value; } }
        NameValueCollection IWebDavRequest.Headers { get { return requestHeaders; } set { requestHeaders = value; } }
        Stream IWebDavRequest.InputStream { get { return requestStream; } set { requestStream = value; } }

        public WebDavSimpleRequest(string method, Uri path, NameValueCollection headers, Stream data)
        {
            requestMethod = method;
            requestUri = path;
            requestHeaders = headers;
            requestStream = data;
        }
        public WebDavSimpleRequest(string method, Uri path)
        {
            requestMethod = method;
            requestUri = path;
            requestHeaders = new NameValueCollection();
            requestStream = new MemoryStream();
        }
    }
}